<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\model\artilce\Artlist;


/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function _initialize()
    {
        $this->config = new \app\common\model\Config;
    }


    public function web_config(){
        $data['min_chose'] = $this->config->getByName('min_chose')['value'];
        $data['gang1_aword'] = $this->config->getByName('gang1_aword')['value'];
        $data['gang2_aword'] = $this->config->getByName('gang2_aword')['value'];

        $guestbook_type = $this->config->getByName('guestbook_type')['value'];

        $this->success('返回成功', $data);
    }

    /**
     * 文章列表
     *
     */
    public function get_art_list()
    {
        $Artlist = new Artlist();
        $art_list = $Artlist->where('statusdata',1)->order('weigh desc')->select();

        $this->success('请求成功',$art_list);
    }

    /**
     * 获取游戏
     *
     */
    public function get_game_list()
    {
        $Artlist = new Artlist();
        $game_list = $Artlist->where('statusdata',1)->order('weigh desc')->select();

        $this->success('请求成功',$game_list);
    }
}
